//true测试环境, false启开正式
let DEBUG    = true 
let BASE_DOM = ''
let BASE_URL = ''

if (process.env.NODE_ENV == 'development') {
  // 开发环境
  BASE_DOM = {
  	local: 'http://127.0.0.1:8070',
  	ngrok: 'http://dllzimu8uu7p.ngrok.xiaomiqiu123.top'
  };
  BASE_DOM = location.hostname.indexOf('.ngrok.') != -1 ? BASE_DOM.ngrok : BASE_DOM.local;
  BASE_URL = location.hostname.indexOf('.ngrok.') != -1 ? '/jeecg-boot' : '/jeecg-boot';
  BASE_URL = BASE_DOM + BASE_URL
  DEBUG = true
} else {
  // 生产环境
  BASE_DOM = 'http://www.yygj.top'
  BASE_URL = BASE_DOM + '/jeecgboot'
  DEBUG = false
}
let staticDomainURL = BASE_URL; // + '/sys/common/static';
//let staticDomainURL = 'http://www.nnxyy.vip' + '/jeecgboot' + '/sys/common/static';

console.info(location.hostname, location.hostname.indexOf('.ngrok.'), BASE_URL)

const configService = {
  domUrl: BASE_DOM,
  apiUrl: BASE_URL,
  staticDomainURL: staticDomainURL,
  ENV: DEBUG
};

export default configService